package com.neusoft.service.Impl;

import com.neusoft.mapper.LoginMapper;
import com.neusoft.po.EmpPO;
import com.neusoft.po.LoginPO;
import com.neusoft.service.LoginService;
import com.neusoft.util.MD5EncryptionUtil;
import com.neusoft.vo.ResetVO;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class LoginServiceImpl implements LoginService {
	@Autowired
	private LoginMapper m;

	@Override
	public EmpPO loginCheck(LoginPO po) {
		if (po != null) {
			po.setPwd(MD5EncryptionUtil.encrypted(po.getPwd()));
			return m.LoginCheck(po);
		} else {
			return null;
		}

	}

	@Override
	public EmpPO selectEmail(ResetVO vo) {
		return m.selectEmail(vo);
	}

	@Override
	public int updatePwd(ResetVO vo) {
		return m.updatePwd(vo);
	}
	
}
